﻿namespace FiftyOne.Foundation.Mobile.Detection.Wurfl.Handlers
{
    using System;

    internal class BlackBerryHandler : RegexSegmentHandler
    {
        private static readonly string[] PATTERNS = new string[] { "(?:(?<=Black[B|b]erry)[^/]+)", @"(?<=Black[B|b]erry\d+/)([\d.]+)", @"VendorID/\d+" };

        internal BlackBerryHandler() : base(PATTERNS, new int[] { 10, 2, 1 })
        {
        }

        protected internal override bool CanHandle(string userAgent)
        {
            return ((userAgent.StartsWith("BlackBerry") || userAgent.StartsWith("Blackberry")) && base.CanHandle(userAgent));
        }
    }
}

